import { request, excelRequest } from "../request";

export function getSubUserOwnedMenu(params) {
  // 获取子用户菜单权限
  return request({
    url: `/product/v31/api/roles/getSubUserOwnedMenu`,
    method: "GET",
    params: params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}

export function saveSubMer(params) {
  // 保存子账号
  return request({
    url: `/product/v31/api/user/saveSubUser?idList=` + params.idList,
    method: "POST",
    params: params.params,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
      token: sessionStorage.getItem("token"),
    },
  });
}

export function updateSubMerMenu(params) {
  // 修改子账号
  return request({
    url: `/product/v31/api/roles/updateUserMenu?idList=` + params.idList,
    method: "POST",
    params: params.params,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
      token: sessionStorage.getItem("token"),
    },
  });
}